package org.opens.db.column.entity;

import lombok.Data;
import org.opens.db.column.ani.TableColumn;
import org.opens.db.column.ani.TableColumns;
import org.opens.db.constant.DbType;

@Data
public class ColumnEntity {

    /**
     * 数据库名
     */
    @TableColumns(
            value = {
                    @TableColumn(value = "table_schema", dbType = DbType.MYSQL),
                    @TableColumn(value = "", dbType = DbType.ORACLE)
            }
    )
    private String databaseName;

    /**
     * 表名
     */
    @TableColumns(
            value = {
                    @TableColumn(value = "table_name", dbType = DbType.MYSQL),
                    @TableColumn(value = "", dbType = DbType.ORACLE)
            }
    )
    private String tableName;

    /**
     * 列名
     */
    @TableColumns(
            value = {
                    @TableColumn(value = "column_name", dbType = DbType.MYSQL),
                    @TableColumn(value = "", dbType = DbType.ORACLE)
            }
    )
    private String columnName;

    /**
     * 列类型
     */
    @TableColumns(
            value = {
                    @TableColumn(value = "data_type", dbType = DbType.MYSQL),
                    @TableColumn(value = "", dbType = DbType.ORACLE)
            }
    )
    private String columnType;

    /**
     * 是否允许为null
     */
    @TableColumns(
            value = {
                    @TableColumn(value = "is_nullable", dbType = DbType.MYSQL),
                    @TableColumn(value = "", dbType = DbType.ORACLE)
            }
    )
    private String nullAble;

    /**
     * 列上的索引
     */
    @TableColumns(
            value = {
                    @TableColumn(value = "column_key", dbType = DbType.MYSQL),
                    @TableColumn(value = "", dbType = DbType.ORACLE)
            }
    )
    private String columnKey;

    /**
     * 表字段注释
     */
    @TableColumns(
            value = {
                    @TableColumn(value = "column_comment", dbType = DbType.MYSQL),
                    @TableColumn(value = "", dbType = DbType.ORACLE)
            }
    )
    private String columnComment;

    private String javaTypeName;

    private String javaFiledName;

    private String jdbcType;

}
